<template>
  <div id="balance_recharge">
    <c-title :hide="false" text="充值"></c-title>
    <!-- 优化 -->
    <diyBackGround></diyBackGround>
    <div class="main">
      <template v-if="priceDifferencePool">
        <!-- price-difference-pool 插件的充值页 复用样式 -->
        <div class="myBalance">当前{{ diyname }}：{{ credit2 }}</div>
        <div class="sum">{{ $i18n.t("money") }}<input type="number" v-model.trim="money" placeholder="请输入金额" /></div>
      </template>
      <template v-if="tagBalance">
        <!-- tag-balance 标签充值 插件 复用样式 -->
        <div class="myBalance">当前{{diyname}}：{{ credit2 }}</div>
        <div class="sum">{{ $i18n.t("money") }}<input type="number" v-model.trim="money" placeholder="请输入金额" /></div>
      </template>
      <template v-else>
        <div class="myBalance">我的{{ balanceLang }}（元）：{{ credit2 }}</div>
        <div class="sum">{{ $i18n.t("money") }}<input type="number" v-model.trim="money" placeholder="请输入金额" /></div>
        <template v-if="activatDes">
          <div class="activityItem" v-if="activatDes && activatDes.sale">
            <div class="acitem" v-for="(item, index) in activatDes.sale" :key="index">
              <div class="left">{{ $i18n.t("money") }}{{ item.enough }}</div>
              <div class="right">赠送{{ discountType(item.give) }}</div>
            </div>
          </div>
          <div class="activityBox" v-if="activatDes.recharge_activity_start">
            <div class="txt">充值活动</div>
            <div class="activityTime">活动时间：{{ activatDes.recharge_activity_start }}——{{ activatDes.recharge_activity_end }}</div>
            <div class="activityNum" v-if="activatDes.recharge_activity_fetter == -1 || activatDes.recharge_activity_fetter == 0">不限</div>
            <div class="activityNum" v-else>参与次数：每人最多参与{{ activatDes.recharge_activity_fetter }}次</div>
          </div>
        </template>
        <template v-if="this.$route.name == 'YccRecharge'">
          <div class="tips"><span style="color:#666;">例如：</span>人民币1元等于{{recharge_double}}个{{plugin_name}}</div>
        </template>
      </template>
    </div>
    <div class="recharge_way" v-if="recharge == 1">
      <div class="title">
        <div class="line"></div>
        <h1>充值方式</h1>
      </div>
      <ul class="choose_box">
        <li @click="confirm_post(btn.value,btn)" v-for="(btn, i) in buttons" :key="i">
          <i class="iconfont" :class="[btnclass_pdp(btn.value)]" v-if="priceDifferencePool"></i>
          <i class="iconfont" :class="[btnclass(btn.value)]" v-else ></i>
          {{ btn.name }}{{ typename }}
        </li>
      </ul>
    </div>
    <pay-keyboard :payKeyboardShow.sync="popupSpecs" @complete="onInput" @close="changePopupSpecs"></pay-keyboard>
  </div>
</template>
<script>
import member_balance_recharge from "./member_balance_rechargecontroller";
export default member_balance_recharge;
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" rel="stylesheet/scss" scoped>
#balance_recharge {
  .recharge_way {
    background: #fff;
    margin: 0 0.625rem;
    margin-top: 0.625rem;

    .title {
      display: flex;
      align-items: center;
      padding-left: 1rem;

      .line {
        width: 0.125rem;
        height: 0.875rem;
        background: var(--themeBaseColor);
      }

      h1 {
        color: var(--themeBaseColor);
        line-height: 2.5rem;
        text-align: left;
        font-size: 0.9375rem;
        font-weight: 400;
        margin-left: 0.625rem;
      }
    }

    li {
      position: relative;
      display: flex;
      align-items: center;
      line-height: 3.5rem;
      font-size: 16px;
      // margin-left: 1.25rem;
      // padding-right: 1.25rem;
      border-bottom: solid 0.0625rem #ebebeb;
      margin: 0 0.625rem;

      .iconfont_bg {
        background: #f15353;
        width: 2.25rem;
        height: 1.5rem;
        border-radius: 0.1875rem;
        display: flex;
        align-items: center;
        margin-right: 0.625rem;
      }

      .icon-balance_d {
        color: #00908c;
      }

      .icon-balance_e {
        color: #64b42e;
      }

      .icon-balance_f {
        color: #fac337;
      }

      .icon-balance_g {
        color: #00508e;
      }

      .icon-balance_h {
        color: #fac337;
      }

      .icon-balance_i {
        color: #64b42e;
      }

      .icon-balance_j {
        color: #069ce7;
      }

      .icon-balance_z {
        background-image: url(../../../assets/images/pay_e.png);
      }

      .iconfont {
        font-size: 2rem;
        margin-right: 0.625rem;
      }
    }

    li:last-child {
      border: none;
    }
  }

  .main {
    margin: 0 0.625rem;
    margin-top: -5.5938rem;
    background: #fff;
    border-radius: 0.625rem;
    padding: 1.125rem 0.875rem 0.8125rem 0.875rem;

    .activityBox {
      text-align: left;
      font-size: 0.625rem;
      color: #666;

      .txt {
        font-size: 0.75rem;
        margin-bottom: 0.6875rem;
        color: #000;
      }

      .activityTime {
        margin-bottom: 0.5rem;
      }
    }

    .activityItem {
      display: flex;
      flex-direction: column;
      margin-top: 0.9063rem;
      margin-bottom: 0.75rem;

      .acitem {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f7f4f8;
        padding: 0.6563rem 0.75rem;
        border-radius: 0.3125rem;
        font-size: 0.625rem;
        margin-bottom: 0.375rem;

        .right {
          color: #f20606;
        }
      }
    }

    .myBalance {
      text-align: left;
    }

    .sum {
      font-size: 0.75rem;
      padding-bottom: 0.5625rem;
      display: flex;
      align-items: center;
      padding-top: 2.1875rem;
      border-bottom: #ffe8e8e8 1px solid;

      input {
        margin-left: 0.4688rem;
        font-weight: 400;
        border: none;
        font-size: 1.125rem !important;
      }
    }
  }

  .content {
    padding-bottom: 5rem;

    .transfer_info {
      background: #fff;
      padding-left: 0.875rem;
      font-size: 16px;

      .info_a,
      .info_b {
        line-height: 2.875rem;
        border-bottom: solid 0.0625rem #ebebeb;
        display: flex;
        justify-content: flex-start;

        span:first-child {
          width: 6.875rem;
          display: block;
          text-align: left;
        }

        input {
          border: none;
          width: 15.625rem;
        }
      }
    }

    .transfer_sum {
      background: #fff;
      padding: 0.625rem 0.875rem;

      span {
        display: block;
        font-size: 16px;
        line-height: 2.5rem;
        text-align: left;
      }

      .sum {
        text-align: left;
        font-size: 24px;

        input {
          margin-left: 0.375rem;
          line-height: 3.75rem;
          width: 90%;
          font-size: 36px;
          border: none;
        }
      }
    }

    .activity_des {
      background: #fff;
      padding: 0.625rem 0.875rem;
      margin-top: 0.625rem;
      text-align: left;

      .title {
        display: block;
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 1rem;
      }

      li {
        position: relative;
        margin: 0.6rem 0.2rem 0.6rem 1rem;

        span {
          font-size: 12px;
        }
      }

      .activity-item::after {
        position: absolute;
        content: "";
        top: 50%;
        left: -0.5rem;
        transform: translateY(-50%);
        width: 2px;
        height: 2px;
        border-radius: 50%;
        background: black;
      }
    }

    .bottom_btn {
      width: 100%;
      background: #fff;
      padding: 0.625rem 0;
      position: fixed;
      bottom: 0;
      border-top: solid 0.0625rem #ebebeb;

      .btn {
        width: 21.5625rem;
        margin: 0 auto;
        height: 2.875rem;
        border-radius: 0.25rem;
        font-size: 16px;
        color: #fff;
        background: #f15353;
        border: none;
      }
    }
  }

  .my_wrapper {
    background: #fff;
    overflow: hidden;
    display: flex;
    padding: 0 14px;
    line-height: 3.0625rem;
    height: 3.0625rem;

    span {
      text-align: left;
      font-size: 16px;
      line-height: 3.0625rem;
    }

    .my-value {
      flex: 2;
      text-align: left;

      span {
        color: #f15353;
      }
    }
  }
}

.mint-field .mint-cell-title {
  width: 5rem;
  -webkit-box-flex: 0;
  -ms-flex: none;
  flex: none;
  text-align: left;
  margin-left: 0.9375rem;
}

.icon-pay_yue {
  color: #ff7433;
}

.icon-pay_wechat {
  color: #ff7433;
}

.icon-pay_alipay {
  color: #29a1f7;
}

.icon-pay_quick {
  color: #46e0d1;
}
.tips{
  text-align: left;
  margin-top: 1rem;
}
</style>
